<template>
  <div class="content">
    <div class="title">
      <p>{{title}}</p>
      <hr />
    </div>
    <div v-html="content"></div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      id: "",
      content: ``,
      title: ""
    };
  },
  created() {
    this.id = this.$route.params.id;
    this.getCarContent();
  },
  methods: {
    async getCarContent() {
      const { data: res } = await this.$http.get(
        `/api/goods/getdesc/${this.id}`
      );
      this.content = res.message[0].content;
      this.title = res.message[0].title;
    }
  }
};
</script>

<style lang="less">
.content {
  display: block;
  margin: 50px 0;
  padding: 0px 5px;
  img {
    width: 100%;
  }
}
.title p {
  color: skyblue;
  text-align: center;
  padding-top: 10px;
  font-weight: bold;
}
</style>